@model PocketPals.Models.LoginViewModel

@{
    ViewData["Title"] = "登录";
    Layout = "_Layout";
}

<div class="container mt-5">
    <div class="row justify-content-center">
        <div class="col-md-6 col-lg-4">
            <div class="card shadow-sm">
                <div class="card-header text-center bg-primary text-white">
                    <h4><i class="fas fa-sign-in-alt me-2"></i>用户登录</h4>
                </div>
                <div class="card-body p-4">
                    <form asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post">
                        @Html.AntiForgeryToken()
                        <div asp-validation-summary="ModelOnly" class="text-danger mb-3"></div>

                        @* Changed from form-floating to standard label/input *@
                        <div class="mb-3">
                            <label asp-for="Username" class="form-label"><i class="fas fa-user me-1"></i>@Html.DisplayNameFor(m => m.Username)</label>
                            <input asp-for="Username" class="form-control" placeholder="请输入用户名" />
                            <span asp-validation-for="Username" class="text-danger d-block mt-1"></span> @* Added d-block mt-1 *@
                        </div>

                        @* Changed from form-floating to standard label/input *@
                        <div class="mb-3">
                            <label asp-for="Password" class="form-label"><i class="fas fa-lock me-1"></i>@Html.DisplayNameFor(m => m.Password)</label>
                            <input asp-for="Password" type="password" class="form-control" placeholder="请输入密码" />
                            <span asp-validation-for="Password" class="text-danger d-block mt-1"></span> @* Added d-block mt-1 *@
                        </div>

                        <div class="form-check mb-3">
                            <input class="form-check-input" type="checkbox" asp-for="RememberMe">
                            <label class="form-check-label" asp-for="RememberMe">
                                @Html.DisplayNameFor(m => m.RememberMe)
                            </label>
                        </div>

                        <div class="d-grid">
                            <button type="submit" class="btn btn-primary btn-lg"><i class="fas fa-sign-in-alt me-2"></i>登录</button>
                        </div>
                    </form>
                </div>
                @* 可选：添加注册或其他链接
                <div class="card-footer text-center">
                    <a asp-action="Register">还没有账户？注册一个</a>
                </div>
                *@
            </div>
        </div>
    </div>
</div>

@section Scripts {
    <partial name="_ValidationScriptsPartial" />
}

<style>
    /* 可选：为登录页面添加一些特定样式 */
    .form-label {
        font-weight: 500; /* Slightly bolder labels like Create page */
    }
    .text-danger {
        font-size: 0.875em; /* Smaller validation text like Create page */
    }
    .card-header {
        border-bottom: 0;
    }
</style>